<!DOCTYPE html>
<html>
<head>
    {include file="public/header" /}
</head>
<body>
<div style="padding-bottom:200px" class="layui-form layuimini-form">
    <!--<form class="layui-form" action="">-->
        <input type="hidden" name="id" value="{$res.id}" />

    <div class="layui-form-item">
        <label class="layui-form-label required">名称</label>
        <div class="layui-input-block">
            <input type="text" value="{$res.title}" name="title" lay-verify="required" lay-reqtext="行业名称不能为空" placeholder="请输入行业名称"  class="layui-input">
        </div>
    </div>
    {if condition="$res.id"}
    <div class="layui-form-item">
        <label class="layui-form-label">缩略图</label>
        <input type="hidden" id="imgurlHidden" name="logo" value="{$res.logo}">
        <div class="layui-input-inline uploadHeadImage">
            <div class="layui-upload-drag" id="headImg">
                <i class="layui-icon"></i>
                <p>点击上传图片，或将图片拖拽到此处</p>
            </div>
        </div>
        <div class="layui-input-inline">
            <div class="layui-upload-list" style="margin-top: 5px;">
                <img class="layui-upload-img headImage" style="height: 100px;" src="{$res.logo}" id="imgurl">
                <p id="demoText"></p>
            </div>
        </div>
    </div>

    {else}

    <div class="layui-form-item">
        <label class="layui-form-label">缩略图</label>
        <input type="hidden" id="imgurlHidden" name="logo">
        <div class="layui-input-inline uploadHeadImage">
            <div class="layui-upload-drag" id="headImg">
                <i class="layui-icon"></i>
                <p>点击上传图片，或将图片拖拽到此处</p>
            </div>
        </div>
        <div class="" style="display: flex">
            <div class="layui-upload-list" style="margin-top: 5px;">
                <img class="layui-upload-img headImage" style="height: 100px;" src="" id="imgurl">
                <p id="demoText"></p>
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>为保证图片质量，缩略图请尽量选择200*200的方形图片,图片大小不要超过500KB,一般在30KB-100KB之间
            </div>
        </div>
    </div>
    {/if}



    {if  condition="$res.category==1" || condition="empty($res)"}
    <div class="layui-form-item">
        <label class="layui-form-label required">所属等级</label>
        <div class="layui-input-block ">
            <select name="level" lay-filter="aihao" >
                {volist name='industry_level_arr' id='v'}
                <option {if condition="$res.level_id==$v.id"} selected {/if} value="{$v.id}">{$v.title}</option>
                {/volist}
            </select>
        </div>
    </div>
    {/if}

   <div class="layui-form-item">
            <label class="layui-form-label">运行状态 </label>
            <div class="layui-input-block">
                <input type="radio" name="status" {if condition="$res.status==1"} checked {/if} value="1" title="运行中" checked="">
                <input type="radio" name="status" {if condition="$res.status==2"} checked {/if} value="2" title="已下架">

            </div>
   </div>


    <div class="layui-form-item">
        <label class="layui-form-label">行业描述</label>
        <div class="layui-input-block">
            <textarea name="desc" class="layui-textarea" placeholder="请输入备注信息">{$res.desc}</textarea>

        </div>
    </div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">行业详情</label>
        <div class="layui-input-block">


           <div class="layui-textarea" id='LAY_demo_editor' ></div>

            <input type="hidden" id="editorimgurlHidden"  name="editor_imgs" value="{$res.editor_imgs}" >
            <!--<input    type="hidden" id="content1" value="{$res.detail}" >-->
        </div>
    </div>



    <div class="layui-form-item">
        <label class="layui-form-label required">基础价值</label>
        <div class="layui-input-block">
            <input type="number" id="min_worth" onblur="ininumber(this)"  {if condition="$res.min_worth"} value="{$res.min_worth}" {else} value="0"   {/if} name="min_worth" lay-verify="required" lay-reqtext="基础价值不能为空"    class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">最高价值</label>
        <div class="layui-input-block">
            <input type="number" id="max_worth" value="{$res.max_worth}" name="max_worth" lay-verify="required" lay-reqtext="最高价值不能为空"   class="layui-input">
        </div>
    </div>



    <div class="layui-form-item">
        <label class="layui-form-label required">收益周期</label>
        <div class="layui-input-block">
            <button type="button" {if condition="$res.category > 1"}  class="layui-btn layui-bg-gray"   {else} onclick="additem()" class="layui-btn" {/if}>添加</button>
        </div>
    </div>
    <div id="bb">
        {if condition="$res.cycle_income"}
        {volist name="$res.cycle_income" id="v" key="k"}
        <div class="layui-form-item" >
            <input type="hidden" name="cycle_id[]"   class="cycle_id"  value="{$v.id}"  >

            <label class="layui-form-label" style="margin-left:50px;width:50px">阶段{$k}</label>
            <div class="layui-inline" >
                <label class="layui-form-label">基础价值</label>
                <div class="layui-input-inline ">
                    <input type="number" name="cycle_min[]"       class="layui-input cycle_min"  value="{$v.min_num}"  {if condition="$k == 1"}  id="first"   {/if}   >
                </div>
            </div>
            <div class="layui-inline" >
                <label class="layui-form-label">收益比例</label>
                <div class="layui-input-inline">
                    <input type="number" name="cycle_income[]" min="0"   value="{$v.day_income}"     class="layui-input cycle_income"  >
                </div>
            </div>
            <div class="layui-inline" >
                <label class="layui-form-label">收益周期</label>
                <div class="layui-input-inline">
                    <input type="number" name="cycle_day[]"    min="0"      value="{$v.cycle_period}"     class="layui-input cycle_day"  >
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">最高价值</label>
                <div class="layui-input-inline">
                    <input type="number"  name="cycle_max[]"   min="0"  value="{$v.max_num}"   class="layui-input cycle_max">
                </div>
            </div>
            {if condition = "$k > 1"}
            <div class="layui-inline" style="width: 50px">
                <div class="layui-input-inline">
                    <button type="button" onclick="delcycle(this)" class="layui-btn">删除</button>
                </div>
            </div>
            {/if}
        </div>
        {/volist}
        {else}
        <div class="layui-form-item " >
            <label class="layui-form-label" style="margin-left:50px;width:50px">阶段1</label>
            <div class="layui-inline" >
                <label class="layui-form-label">基础价值</label>
                <div class="layui-input-inline ">
                    <input type="number"  name="cycle_min[]"       class="layui-input cycle_min"  id="first"   {if condition="$res.min_worth"} value="{$res.min_worth}" {else} value="0"  {/if}   >
                </div>
            </div>
            <div class="layui-inline" >
                <label class="layui-form-label">收益比例</label>
                <div class="layui-input-inline">
                    <input type="number" name="cycle_income[]"  min="0"  value="0"      class="layui-input cycle_income"  >
                </div>
            </div>
            <div class="layui-inline" >
                <label class="layui-form-label">收益周期</label>
                <div class="layui-input-inline">
                    <input type="number" name="cycle_day[]"    value="0"   min="0"    class="layui-input cycle_day"  >
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">最高价值</label>
                <div class="layui-input-inline">
                    <input type="number"  name="cycle_max[]"      value="0" min="0"    class="layui-input cycle_max">
                </div>
            </div>

        </div>

        {/if}

    </div>

    <div id="hideDetail" style="display: none">
        {$res.detail}
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>


    <!--</form>-->
</div>
{include file="public/footer" /}
<script src="/static/admin/industry/saveinfo.js?v={$Think.const.TIMESTAMP}" charset="utf-8"></script>

<script>
</script>

</body>
</html>